// Copyright 2013 Square, Inc.

package com.wu.family.views;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.TextView;

public class GridLineView extends ImageView {

  private Paint paint = new Paint(Paint.SUBPIXEL_TEXT_FLAG
          |Paint.ANTI_ALIAS_FLAG);
  final int LINENUM = 3;
  
  public GridLineView(Context context) {
    super(context);
  }

  public GridLineView(Context context, AttributeSet attrs) {
    super(context, attrs);
  }

  public GridLineView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
  }


	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		paint.setColor(0xffffffff);
		int width = getWidth();
		int height = getHeight();
		
		for (int i = 1; i <= LINENUM; i++) {
			canvas.drawLine(0, height*i/(LINENUM+1), width, height*i/(LINENUM+1), paint);
		}
		for (int i = 1; i <= LINENUM; i++) {
			canvas.drawLine(width*i/(LINENUM+1), 0, width*i/(LINENUM+1), height, paint);
		}
	}


}
